﻿<phone:PhoneApplicationPage 
    x:Class="DevPhoneToolkitSample.Samples.UpDownControlSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:DevPhone="clr-namespace:DevPhone.Controls;assembly=DevPhone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent" Margin="0,20">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel>
            <Border Background="White" VerticalAlignment="Top" BorderBrush="Gray" BorderThickness="1">
                <Image Name="Logo" Source="/DevPhoneToolkitSample;component/Images/DevPhoneToolkit.png" Stretch="None" VerticalAlignment="Top" HorizontalAlignment="Left" />
            </Border>
        </StackPanel>
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,20,12,10">
            <ScrollViewer>
                <StackPanel>
                    <TextBlock Text="UpDown Control Samples" FontSize="32"/>
                    <TextBlock Text="Input a ranger vaues that can be between minimum and maximum value. Speed change with hold press" TextWrapping="Wrap" FontSize="18" Margin="0,0,0,20" />
                    <StackPanel Orientation="Vertical">
                        <TextBlock Text="Basic" FontSize="48" Foreground="{StaticResource PhoneAccentBrush}" />
                        <TextBlock Text="Tap or hold arrows" Margin="0,20,0,0" />
                        <DevPhone:UpDownControl x:Name="UpDn0" Header="Sample" Increment="1" IncrementHold="10" MaxValue="100" CurrentValue="50" />
                        <TextBlock Text="Binding Value" Margin="0,20,0,0" />
                        <TextBlock Text="{Binding ElementName=UpDn0, Path=CurrentValue}" Foreground="{StaticResource PhoneAccentBrush}" Margin="0,20,0,20"/>
                        <DevPhone:UpDownControl Increment="1" IncrementHold="10" MaxValue="100" CurrentValue="50" LoopValues="True" >
                            <DevPhone:UpDownControl.HeaderTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="LoopValue Sample" VerticalAlignment="Center" />
                                        <Image Source="/DevPhoneToolkitSample;component/Images/new.png" Margin="10,0,0,0" />
                                    </StackPanel>
                                </DataTemplate>
                            </DevPhone:UpDownControl.HeaderTemplate>
                        </DevPhone:UpDownControl>
                        <DevPhone:UpDownControl x:Name="UpDn1" Increment="1" IncrementHold="10" MaxValue="100" CurrentValue="50" Margin="0,20,0,0">
                            <DevPhone:UpDownControl.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock Text="Custom Header" Foreground="#99FF6407" FontWeight="Bold" FontSize="32" />
                                </DataTemplate>
                            </DevPhone:UpDownControl.HeaderTemplate>
                        </DevPhone:UpDownControl>
                    </StackPanel>
                    <StackPanel Orientation="Vertical" Margin="0,20,0,0">
                        <TextBlock Text="Arrows" FontSize="48" Foreground="{StaticResource PhoneAccentBrush}" />
                        <DevPhone:UpDownControl x:Name="UpDn2" Header="Sample up/down direction" Increment="1" IncrementHold="10" MaxValue="100" CurrentValue="50" ArrowDirection="UpDown" GapArrow="10" />
                        <DevPhone:UpDownControl x:Name="UpDn3" Header="Sample custom color" Increment="1" IncrementHold="10" MaxValue="100" CurrentValue="50" ArrowDirection="LeftRight" Margin="0,20,0,0">
                            <DevPhone:UpDownControl.ArrowColor>
                                <RadialGradientBrush>
                                    <GradientStop Color="White" Offset="0" />
                                    <GradientStop Color="#FF42C71A" Offset="1" />
                                </RadialGradientBrush>
                            </DevPhone:UpDownControl.ArrowColor>
                        </DevPhone:UpDownControl>
                        <DevPhone:UpDownControl x:Name="UpDn4" Header="Sample external arrows" Increment="1" IncrementHold="10" MaxValue="100" CurrentValue="50" ArrowDirection="External" GapArrow="30" Margin="0,20,0,0" ExternalPathLeft="M 15,0 L 0,15 L 15,30 L 10,15 Z" ExternalPathRight="M 15,0 L 30,15 L 15,30 L 20, 15 Z" ArrowColor="#FFFF0D80" ArrowDisabledColor="#663EB4A0" />
                    </StackPanel>
                    <StackPanel Orientation="Vertical">
                        <TextBlock Text="Custom values" FontSize="48" Foreground="{StaticResource PhoneAccentBrush}" />
                        <DevPhone:UpDownControl x:Name="UpDn5" Header="Sample On/Off" Increment="1" MinValue="0" MaxValue="1" CurrentValue="1" UpDownValueChanged="UpDn5UpDownValueChanged" />
                        <DevPhone:UpDownControl x:Name="UpDn6" Header="Sample value less than 10 = off and skip 10 to 10" Increment="10" IncrementHold="10" IncrementHoldStart="0" MaxValue="100" CurrentValue="50" UpDownValueChanged="UpDn6UpDownValueChanged" SpeedHold="100" Margin="0,20,0,0" />
                        <DevPhone:UpDownControl x:Name="UpDn7" Header="Sample with custom countries list" Increment="1" IncrementHold="1" IncrementHoldStart="0" MaxValue="4" CurrentValue="0" UpDownValueChanged="UpDn7UpDownValueChanged" Margin="0,20,0,0" />
                    </StackPanel>

                </StackPanel>
            </ScrollViewer>
        </Grid>
    </Grid>
</phone:PhoneApplicationPage>
